import { useSelector } from 'react-redux';
import { RootState } from '../store'; // 导入根状态类型

const useUser = () => {
  const user = useSelector((state: RootState) => state.user);
  // 判断用户是否登录
  const isLoggedIn = user.token !== null; 

  return { user, isLoggedIn };
};

export default useUser;